package com.yanqu.road.entity.activity.able;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

import java.util.Date;

@FieldTypeAnnotation(tableName = "t_u_able_data")
public class UserAbleData extends DataObject {

    @FieldTypeAnnotation(desc = "玩家ID", update = true, select = true)
    private long userId;

    @FieldTypeAnnotation(desc = "活动ID", update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "凭证ID")
    private int ableItemId;

    @FieldTypeAnnotation(desc = "获得资格时间")
    private Date ableTime;

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getAbleItemId() {
        return ableItemId;
    }

    public void setAbleItemId(int ableItemId) {
        if (this.ableItemId != ableItemId) {
            this.ableItemId = ableItemId;
            setOp(DataStatus.Update);
        }
    }

    public Date getAbleTime() {
        return ableTime;
    }

    public void setAbleTime(Date ableTime) {
        if (ableTime == null) {
            return;
        }
        if (this.ableTime == null || !this.ableTime.equals(ableTime)) {
            this.ableTime = ableTime;
            setOp(DataStatus.Update);
        }
    }
}
